package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ErpContractMapper;
import com.ruoyi.system.domain.ErpContract;
import com.ruoyi.system.service.IErpContractService;

/**
 * ERP-合同Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-26
 */
@Service
public class ErpContractServiceImpl implements IErpContractService 
{
    @Autowired
    private ErpContractMapper erpContractMapper;

    /**
     * 查询ERP-合同
     * 
     * @param id ERP-合同主键
     * @return ERP-合同
     */
    @Override
    public ErpContract selectErpContractById(Long id)
    {
        return erpContractMapper.selectErpContractById(id);
    }

    /**
     * 查询ERP-合同列表
     * 
     * @param erpContract ERP-合同
     * @return ERP-合同
     */
    @Override
    public List<ErpContract> selectErpContractList(ErpContract erpContract)
    {
        return erpContractMapper.selectErpContractList(erpContract);
    }

    /**
     * 新增ERP-合同
     * 
     * @param erpContract ERP-合同
     * @return 结果
     */
    @Override
    public int insertErpContract(ErpContract erpContract)
    {
        erpContract.setCreateTime(DateUtils.getNowDate());
        return erpContractMapper.insertErpContract(erpContract);
    }

    /**
     * 修改ERP-合同
     * 
     * @param erpContract ERP-合同
     * @return 结果
     */
    @Override
    public int updateErpContract(ErpContract erpContract)
    {
        erpContract.setUpdateTime(DateUtils.getNowDate());
        return erpContractMapper.updateErpContract(erpContract);
    }

    /**
     * 批量删除ERP-合同
     * 
     * @param ids 需要删除的ERP-合同主键
     * @return 结果
     */
    @Override
    public int deleteErpContractByIds(Long[] ids)
    {
        return erpContractMapper.deleteErpContractByIds(ids);
    }

    /**
     * 删除ERP-合同信息
     * 
     * @param id ERP-合同主键
     * @return 结果
     */
    @Override
    public int deleteErpContractById(Long id)
    {
        return erpContractMapper.deleteErpContractById(id);
    }
}
